import http from '@http/http'
function severice () {
  let myseverice = {}
  // 根据sn查看辅导员、学院、学校用户个人信息
  myseverice._findPersonalInfoBySn = () => {
    return http.GET(`./api/managerInfo/findBySn`)
  }
  // 获取学生信息列表
  myseverice._getStudentInfoList = data => {
    return http.POST(`./api/managerInfo/getStudentInfoList`, data)
  }
  // 修改辅导员、学院、学校用户个人信息
  myseverice._updateManagerInfo = data => {
    return http.POST(`./api/managerInfo/update`, data)
  }
  // 导出
  myseverice._managerExport = data => {
    return http.POST(`./api/managerInfo/export`, data, '接口异常', 300000)
  }
  // 根据sn查看学生个人信息
  myseverice._findStudentInfoBySn = sn => {
    return http.GET(`./api/infoManagement/findPersonalInfoBySn/` + sn)
  }
  // 修改家庭成员信息
  myseverice._updateStudentFamilyMember = data => {
    return http.POST(`./api/infoManagement/updateStudentFamilyMember`, data)
  }
  // 添加家庭成员信息
  myseverice._saveStudentFamilyMember = data => {
    return http.POST(`./api/infoManagement/saveStudentFamilyMember`, data)
  }
  // 修改家庭信息
  myseverice._updateStudentFamilyInfo = data => {
    return http.POST(`./api/infoManagement/updateFamilyRelationsBySn`, data)
  }
  // 删除家庭成员
  myseverice._delStudentFamilyMember = sn => {
    return http.GET(`./api/infoManagement/deleteStudentFamilyMember/` + sn)
  }
  // 删除家庭成员
  myseverice._findFamilyRelationsBySn = sn => {
    return http.GET(`./api/infoManagement/findFamilyRelationsBySn/` + sn)
  }
  // 删除家庭成员
  myseverice._schoolFindStudentFamilMember = sn => {
    return http.GET(`./api/infoManagement/findStudentFamilMember/` + sn)
  }
  // 男女映射
  myseverice._genderType = id => {
    switch (id) {
      case 1:
        return {
          id: 1,
          name: '男'
        }
      case 2:
        return {
          id: 2,
          name: '女'
        }
      default:
        return {
          id: -1,
          name: '未知'
        }
    }
  }
  // 政治面貌
  myseverice._politicalStatus = (id) => {
    switch (id) {
      case -1:
        return {
          'id': -1,
          'name': '未知'
        }
      case 1:
        return {
          'id': 1,
          'name': '群众'
        }
      case 2:
        return {
          'id': 2,
          'name': '中共党员'
        }
      case 3:
        return {
          'id': 3,
          'name': '中共预备党员'
        }
      case 4:
        return {
          'id': 4,
          'name': '共青团员'
        }
      case 5:
        return {
          'id': 5,
          'name': '民革党员'
        }
      case 6:
        return {
          'id': 6,
          'name': '民盟盟员'
        }
      case 7:
        return {
          'id': 7,
          'name': '民建会员'
        }
      case 8:
        return {
          'id': 8,
          'name': '民进会员'
        }
      case 9:
        return {
          'id': 9,
          'name': '农工党党员'
        }
      case 10:
        return {
          'id': 10,
          'name': '致公党党员'
        }
      case 11:
        return {
          'id': 11,
          'name': '九三学社社员'
        }
      case 12:
        return {
          'id': 12,
          'name': '台盟盟员'
        }
      case 13:
        return {
          'id': 13,
          'name': '无党派民主人士'
        }
      default:
        return {
          id: null,
          name: null
        }
    }
  }
  // 证件类型
  myseverice._cardType = (id) => {
    switch (id) {
      case 1:
        return {
          'id': 1,
          'name': '居民身份证'
        }
      case 2:
        return {
          'id': 2,
          'name': '护照'
        }
      case 3:
        return {
          'id': 3,
          'name': '其他'
        }
      default:
        return {
          'id': null,
          'name': null
        }
    }
  }
  return myseverice
}
export default severice
